<!DOCTYPE HTML>
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <title>Sgvizler</title>
    <meta charset="UTF-8"/>
    <link rel="shortcut icon" href="../../www/favicon.ico" />
    <style type="text/css">
      div#footer{
      border-top: 1px solid #ccc;
      color: #666;
      font-size: 80%;
      }
      div#footer a{
      color: #555;
      }
    </style>
    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.8/jquery.min.js"></script>  
    <script type="text/javascript" src="https://www.google.com/jsapi"></script>
    <script type="text/javascript" src="../sgvizler.js"></script>
    <script type="text/javascript">
      sgvizler
          .defaultEndpointURL("http://sws.ifi.uio.no/sparql/npd")
          .prefix('npdv', 'http://sws.ifi.uio.no/vocab/npd#');
      
      //// Leave this as is. Ready, steady, go!
      $(document).ready(sgvizler.containerDrawAll);
    </script>
  </head>
  <body>
    <h1>Sgvizler</h1>

    <p>Test page for Sgvizler. Tests if it handles empty results,
    "missing variables", OPTIONALs, in both formats: JSON and XML.</p>
    
    <p>All queries are sent
      to <a href="http://sws.ifi.uio.no/sparql/npd">http://sws.ifi.uio.no/sparql/npd</a>
    </p>
    
    <h2>1: XML</h2>

    <div id="sgvzl_example1" 
	 data-sgvizler-query="SELECT ?year ?Oil ?Gas ?NGL ?Condensate ?Water
			      WHERE{ ?period a npdv:FieldProductionPeriod ;
			      npdv:hasField <http://sws.ifi.uio.no/npd/field/Ekofisk> ;
			      npdv:year ?year ;
			      npdv:producedNetOilMillSm3 ?Oil ;
			      npdv:producedNetGasBillSm3 ?Gas ;
			      npdv:producedNetNGLMillSm3 ?NGL ;
			      npdv:producedNetCondensateMillSm3 ?Condensate ;
			      npdv:producedWaterMillSm3  ?Water ;
			      } LIMIT 10"
	 data-sgvizler-endpoint_output="xml"
	 data-sgvizler-chart="sgvizler.visualization.Text"
	 data-sgvizler-log="2"
	 style="width:800px; height:100px;"
	 ></div>

    <h2>2: JSON</h2>

    <div id="sgvzl_example2"
	 data-sgvizler-query="SELECT xsd:int(?year) ?Oil ?Gas ?NGL ?Condensate ?Water
			      WHERE{ ?period a npdv:FieldProductionPeriod ;
			      npdv:hasField <http://sws.ifi.uio.no/npd/field/Ekofisk> ;
			      npdv:year ?year ;
			      npdv:producedNetOilMillSm3 ?Oil ;
			      npdv:producedNetGasBillSm3 ?Gas ;
			      npdv:producedNetNGLMillSm3 ?NGL ;
			      npdv:producedNetCondensateMillSm3 ?Condensate ;
			      npdv:producedWaterMillSm3  ?Water ;
			      } LIMIT 10"
	 data-sgvizler-endpoint_output="json"
	 data-sgvizler-chart="sgvizler.visualization.Text"
	 data-sgvizler-log="2"
	 style="width:800px; height:100px;"
	 ></div>


    <h2>3: XML, no results</h2>

    <div id="sgvzl_example3" 
	 data-sgvizler-query="SELECT ?year ?Oil ?Gas ?NGL ?Condensate ?Water
			      WHERE{ } LIMIT 10"
	 data-sgvizler-endpoint_output="xml"
	 data-sgvizler-chart="sgvizler.visualization.Text"
	 data-sgvizler-log="2"
	 style="width:800px; height:100px;"
	 ></div>

    <h2>4: JSON, no results</h2>

    <div id="sgvzl_example4"
	 data-sgvizler-query="SELECT ?year ?Oil ?Gas ?NGL ?Condensate ?Water
			      WHERE{ } LIMIT 10"
	 data-sgvizler-endpoint_output="json"
	 data-sgvizler-chart="sgvizler.visualization.Text"
	 data-sgvizler-log="2"
	 style="width:800px; height:100px;"
	 ></div>


    <h2>5: XML, some results</h2>

    <div id="sgvzl_example5" 
	 data-sgvizler-query="SELECT ?year ?Oil ?Gas ?NGL ?Condensate ?Water
			      WHERE{ { LET(?year := 10000) }
			      UNION
			      { ?period a npdv:FieldProductionPeriod ;
			      npdv:hasField <http://sws.ifi.uio.no/npd/field/Ekofisk> ;
			      npdv:producedNetGasBillSm3 ?Gas ;
			      npdv:producedNetNGLMillSm3 ?NGL ;
			      npdv:producedNetCondensateMillSm3 ?Condensate ;
			      npdv:producedWaterMillSm3  ?Water ; } }
			      LIMIT 10"
	 data-sgvizler-endpoint_output="xml"
	 data-sgvizler-chart="sgvizler.visualization.Text"
	 data-sgvizler-log="2"
	 style="width:800px; height:100px;"
	 ></div>

    <h2>6: JSON, some results</h2>

    <div id="sgvzl_example6"
	 data-sgvizler-query="SELECT ?year ?Oil ?Gas ?NGL ?Condensate ?Water
			      WHERE{ { LET(?year := 10000) }
			      UNION
			      { ?period a npdv:FieldProductionPeriod ;
			      npdv:hasField <http://sws.ifi.uio.no/npd/field/Ekofisk> ;
			      npdv:producedNetGasBillSm3 ?Gas ;
			      npdv:producedNetNGLMillSm3 ?NGL ;
			      npdv:producedNetCondensateMillSm3 ?Condensate ;
			      npdv:producedWaterMillSm3  ?Water ; } }
			      LIMIT 10"
	 data-sgvizler-endpoint_output="json"
	 data-sgvizler-chart="sgvizler.visualization.Text"
	 data-sgvizler-log="2"
	 style="width:800px; height:100px;"
	 ></div>

    <div id="footer">
      <!-- Please leave a link to the Sgvizler homepage --> 
      <p>
	Sgvizler visualizes the result of SPARQL SELECT queries using
	javascript and the Google Visualization API. For more
	information, see
	the <a href="http://sgvizler.googlecode.com/">Sgvizler</a>
	homepage. (c)
	2011 Martin G. Skj&#230;veland.
      </p>
    </div>
  </body>
</html>
